package com.FactoryDemo;

import com.Prototype.Apple;
import com.Prototype.MyFruit;

public class ClientClass {
    public static void main(String[] args) {
        MyFruit fru1 = new Apple();
        MyFruit fru2 = (Apple)fru1.clone();
        fru1.Display();
        fru2.Display();
        System.out.println("fru1:"+fru1.hashCode());
        System.out.println("fru2:"+fru2.hashCode());
    }
    public String factory(String fruitName){
        if(fruitName.equals("Apple"))
            return "Apple";
        if(fruitName.equals("Banana"))
            return "Banana";
        return null;
    }
}
